package org.example.common.core.utils.ribbon;

import com.alibaba.ttl.TransmittableThreadLocal;
import org.springframework.util.ObjectUtils;

public class GrayRequestContextHandler {
    private static ThreadLocal<Boolean> grayTag=new TransmittableThreadLocal<>();
    public static void setGrayTag(Boolean flags) {
        grayTag.set(flags);
    }
    public static boolean getGrayTag(){
        Boolean tag=  grayTag.get();
        if(ObjectUtils.isEmpty(tag)){
            grayTag.set(false);
        }
       return  grayTag.get();
    }
    public static void remove(){
        grayTag.remove();
    }
}
